<template>
    <div class="online-payment-container">
        <!-- 顶部标签页 -->
        <el-tabs v-model="activeTab" class="payment-tabs">
            <el-tab-pane label="在线收款介绍" name="introduction"></el-tab-pane>
            <el-tab-pane label="在线收款配置" name="configuration"></el-tab-pane>
        </el-tabs>

        <!-- 内容区域 -->
        <div class="content-area">
            <!-- 在线收款介绍页面 -->
            <template v-if="activeTab === 'introduction'">
                <!-- 推荐支付服务商区域 -->
                <div class="recommendation-card">
                    <div class="recommend-tag">推荐</div>
                    <div class="payment-provider">
                        <img src="https://s.17win.com/snack/129/86d208385583490496b13d73b3a25d50.png" alt="通联支付logo"
                            class="provider-logo">
                        <div class="provider-info">
                            <h3>通联支付 ALL IN PAY</h3>
                            <p>成立于2008年，首批获得央行颁发的支付牌照，是中国支付清算协会副会长单位。</p>
                            <div class="provider-advantages">
                                <p>推荐理由: 手续费更低: <span class="highlight">0.25%</span>（包含微信、支付宝支付）</p>
                                <p>开通更迅速: 线上申请，大约 <span class="highlight">2 工作日</span>审核通过</p>
                            </div>
                        </div>
                        <el-button class="open-now-btn">线上开通</el-button>
                    </div>
                </div>

                <!-- 解决方案对比区域 -->
                <div class="solution-section">
                    <h2>代账公司在线收款解决方案</h2>

                    <!-- 以前的流程 -->
                    <div class="process-comparison">
                        <div class="process-card old-process">
                            <h3>以前 <span class="process-tag">全人工收费操作</span></h3>
                            <div class="process-flow">
                                <div class="process-node">
                                    <div class="node-icon">
                                        <!-- 替换图标为图片，src替换为实际图片路径 -->
                                        <img src="https://s.17win.com/snack/129/17ceee4e6c594b63b71f1c891a2d9278.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">账单发给客户</div>
                                </div>
                                <div class="process-arrow">→</div>
                                <div class="process-node">
                                    <div class="node-icon">
                                        <!-- 替换图标为图片，src替换为实际图片路径 -->
                                        <img src="https://s.17win.com/snack/129/e5543faef49244ed8bfe8734710a2adc.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">客户转账到公司</div>
                                </div>
                                <div class="process-arrow manual-arrow">→ 人工</div>
                                <div class="process-node">
                                    <div class="node-icon">
                                        <!-- 替换图标为图片，src替换为实际图片路径 -->
                                        <img src="https://s.17win.com/snack/129/6353644fb73644009fe6fcf01692a382.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">员工收费登记</div>
                                </div>
                                <div class="process-arrow manual-arrow">→人工</div>
                                <div class="process-node">
                                    <div class="node-icon">
                                        <!-- 替换图标为图片，src替换为实际图片路径 -->
                                        <img src="https://s.17win.com/snack/129/25efa4c08a8a45ae939b3ec9ac9bbe94.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">出纳手动核对流水</div>
                                </div>
                            </div>
                        </div>

                        <!-- 流程对比切换器 -->
                        <div class="process-toggle">
                            收款流程对比
                            <i class="el-icon-arrow-down"></i>
                        </div>

                        <!-- 现在的流程 -->
                        <div class="process-card new-process">
                            <h3>现在 <span class="process-tag advantage-tag">全自动化收费</span></h3>
                            <div class="process-flow">
                                <div class="process-node">
                                    <div class="node-icon">
                                        <!-- 替换图标为图片，src替换为实际图片路径 -->
                                        <img src="https://s.17win.com/snack/129/17ceee4e6c594b63b71f1c891a2d9278.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">账单发给客户</div>
                                </div>
                                <div class="process-arrow">→</div>
                                <div class="process-node highlighted-node">
                                    <div class="node-icon highlighted-icon">
                                        <img src="https://s.17win.com/snack/129/60b21fa9d7b449aa930c79969a2d5165.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">客户在线支付</div>
                                </div>
                                <div class="process-arrow">→</div>
                                <div class="process-node highlighted-node">
                                    <div class="node-icon highlighted-icon">
                                        <img src="https://s.17win.com/snack/129/7ba89c916af148d7ac8bb84b4bd2a799.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">系统自动收费登记</div>
                                </div>
                                <div class="process-arrow">→</div>
                                <div class="process-node highlighted-node">
                                    <div class="node-icon highlighted-icon">
                                        <img src="https://s.17win.com/snack/129/95ea20daab574498b563061aae5902a2.png"
                                            alt="账单图标" class="node-image">
                                    </div>
                                    <div class="node-text">在线记录，批量审核</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 优势特点区域 -->
                <div class="advantages-section">
                    <h2>收费精准、省时省力，体现公司的规范和专业</h2>

                    <div class="advantages-grid">
                        <!-- 优势卡片1 -->
                        <div class="advantage-card">
                            <div class="advantage-icon">
                                <img src="https://s.17win.com/snack/129/4363ca612df543749c6821582c6512aa.png" alt="账单图标"
                                    class="node-image">
                            </div>
                            <h3>支持多企业账号绑定</h3>
                            <ul class="advantage-details">
                                <li>客户A支付 → 进公司1的账户</li>
                                <li>客户B支付 → 进公司2的账户</li>
                            </ul>
                        </div>

                        <!-- 优势卡片2 -->
                        <div class="advantage-card">
                            <div class="advantage-icon">
                                <img src="https://s.17win.com/snack/129/254461f191a043258cb3ddd1dee47597.png" alt="账单图标"
                                    class="node-image">
                            </div>
                            <h3>支持微信、支付宝支付</h3>
                            <ul class="advantage-details">
                                <li>微信: 借记卡支付、信用卡支付</li>
                                <li>支付宝: 借记卡支付、信用卡支付、花呗、花呗分期</li>
                            </ul>
                        </div>

                        <!-- 优势卡片3 -->
                        <div class="advantage-card">
                            <div class="advantage-icon">
                                <img src="https://s.17win.com/snack/129/ebcf4535e9ff4c03affe60d94d72dff1.png" alt="账单图标"
                                    class="node-image">
                            </div>
                            <h3>企业和个体工商户可以开通</h3>
                            <ul class="advantage-details">
                                <li>企业 → 绑定企业对公账户</li>
                                <li>个体工商户 → 绑定法人个人银行卡</li>
                            </ul>
                        </div>

                        <!-- 优势卡片4 -->
                        <div class="advantage-card">
                            <div class="advantage-icon">
                                <img src="https://s.17win.com/snack/129/46b56b90e40649b189318bcfd60cc3a6.png" alt="账单图标"
                                    class="node-image">
                            </div>
                            <h3>费率低、自动到账无需提现</h3>
                            <ul class="advantage-details">
                                <li>手续费: 0.25%</li>
                                <li>到账规则: 扣除手续费后, T+1自动到账, 无需提现。</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </template>

            <!-- 在线收款配置页面 -->
            <template v-if="activeTab === 'configuration'">
                <div class="configuration-header">
                    <a href="https://17dz.com/help-web-pc/#/front/help/content/1675684016131/0?cateId=1676889321935&detailId=problem1676425670111"
                        class="help-link">还不会开通? 查看操作手册</a>
                    <el-button class="open-account-btn">在线收款账户开通</el-button>
                </div>

                <div class="configuration-table">
                    <el-table :data="accountList" border style="width: 100%;">
                        <el-table-column prop="accountName" label="收款账户" width="180"
                            header-style="font-weight: 900; color: #000;">
                        </el-table-column>
                        <el-table-column prop="status" label="账户状态" width="180"
                            header-style="font-weight: 900; color: #000;">
                        </el-table-column>
                        <el-table-column prop="merchantId" label="商户号" width="180"
                            header-style="font-weight: 900; color: #000;"></el-table-column>
                        <el-table-column prop="receiptScope" label="收款范围"
                            header-style="font-weight: 900; color: #000;"></el-table-column>
                        <el-table-column prop="operation" label="账户操作" width="180"
                            header-style="font-weight: 900; color: #000;"></el-table-column>
                    </el-table>

                    <!-- 空状态显示 -->

                </div>
            </template>
        </div>

        <!-- 右侧帮助按钮 -->
        <div class="help-button">
            <div class="help-icon">
                <i class="el-icon-headset"></i>
            </div>
            <div class="help-text">获取帮助</div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';

// 标签页状态
const activeTab = ref('introduction');

// 收款账户列表数据
const accountList = ref([]);
</script>

<style lang="less" scoped>
.online-payment-container {
    padding: 20px;
    background-color: #f5f7fa;
    min-height: 100vh;
    position: relative;

    .payment-tabs {
        margin-bottom: 20px;

        ::v-deep .el-tabs__item.is-active {
            color: #ff7d00;
        }

        ::v-deep .el-tabs__active-bar {
            background-color: #ff7d00;
        }
    }

    .content-area {
        background-color: #fff;
        border-radius: 4px;
        padding: 20px;
        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
    }

    // 推荐区域样式
    .recommendation-card {
        background-color: #fff8e6;
        border-radius: 6px;
        padding: 15px;
        margin-bottom: 30px;
        position: relative;

        .recommend-tag {
            position: absolute;
            top: 0;
            left: 0;
            background-color: #ff7d00;
            color: white;
            padding: 2px 10px;
            border-radius: 4px 0 4px 0;
            font-weight: bold;
            font-size: 12px;
        }

        .payment-provider {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .provider-logo {
                width: 60px;
                height: 60px;
                margin-right: 15px;
            }

            .provider-info {
                flex: 1;

                h3 {
                    margin: 0 0 10px 0;
                    color: #333;
                    font-size: 16px;
                }

                p {
                    margin: 0 0 8px 0;
                    color: #666;
                    line-height: 1.5;
                }

                .provider-advantages {
                    margin-top: 10px;

                    .highlight {
                        color: #ff7d00;
                        font-weight: bold;
                    }
                }
            }

            .open-now-btn {
                background-color: #ff7d00;
                color: white;
                border: none;

                &:hover {
                    background-color: #e66a00;
                }
            }
        }
    }

    // 解决方案区域样式
    .solution-section {
        margin-bottom: 40px;

        h2 {
            color: #333;
            font-size: 18px;
            margin-bottom: 20px;
            padding-left: 5px;
            border-left: 3px solid #ff7d00;
        }

        .process-comparison {
            background-color: #f9f9f9;
            border-radius: 6px;
            padding: 20px;

            .process-card {
                margin-bottom: 20px;

                h3 {
                    color: #333;
                    margin-bottom: 15px;
                    font-size: 16px;

                    .process-tag {
                        font-size: 12px;
                        padding: 2px 8px;
                        border-radius: 4px;
                        margin-left: 10px;
                        background-color: #eaeaea;
                        color: #666;
                    }

                    .advantage-tag {
                        background-color: #e6f7ff;
                        color: #1890ff;
                    }
                }

                .process-flow {
                    display: flex;
                    align-items: center;
                    flex-wrap: wrap;

                    .process-node {
                        display: flex;
                        flex-direction: column;
                        align-items: center;
                        min-width: 120px;

                        .node-icon {
                            width: 70px;
                            height: 70px;
                            border-radius: 50%;
                            background-color: #eaeaea;
                            color: #666;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            margin-bottom: 5px;
                            font-size: 18px;
                        }

                        .node-text {
                            font-size: 13px;
                            color: #666;
                            text-align: center;
                        }
                    }

                    .process-arrow {
                        margin: 0 10px;
                        color: #ccc;
                    }

                    .manual-arrow {
                        color: #ff7d00;
                        font-weight: bold;
                    }

                    .highlighted-node {
                        .node-icon.highlighted-icon {
                            background-color: #ff7d00;
                            color: white;
                        }

                        .node-text {
                            color: #ff7d00;
                            font-weight: bold;
                        }
                    }
                }
            }

            .process-toggle {
                text-align: center;
                color: #1890ff;
                cursor: pointer;
                margin: 10px 0;
                font-size: 14px;
                display: flex;
                align-items: center;
                justify-content: center;

                i {
                    margin-left: 5px;
                    font-size: 12px;
                }
            }
        }
    }

    // 优势特点区域样式
    .advantages-section {
        h2 {
            color: #333;
            font-size: 18px;
            margin-bottom: 20px;
            padding-left: 5px;
            border-left: 3px solid #ff7d00;
        }

        .advantages-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;

            .advantage-card {
                border: 1px solid #f0f0f0;
                border-radius: 6px;
                padding: 15px;
                transition: all 0.3s;

                &:hover {
                    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
                }

                .advantage-icon {
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    background-color: #f5f5f5;
                    color: #ff7d00;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    margin-bottom: 10px;
                    font-size: 20px;
                }

                h3 {
                    color: #333;
                    font-size: 16px;
                    margin: 0 0 10px 0;
                }

                .advantage-details {
                    padding-left: 20px;
                    margin: 0;

                    li {
                        color: #666;
                        font-size: 14px;
                        margin-bottom: 5px;
                        line-height: 1.5;
                    }
                }
            }
        }
    }

    // 配置页面样式
    .configuration-header {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-bottom: 20px;

        .help-link {
            color: #1890ff;
            text-decoration: none;
            margin-right: 15px;
            font-size: 14px;

            &:hover {
                text-decoration: underline;
            }
        }

        .open-account-btn {
            background-color: #ff7d00;
            color: white;
            border: none;

            &:hover {
                background-color: #e66a00;
            }
        }
    }

    .configuration-table {
        min-height: 200px;
        position: relative;


        .empty-state {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;

            .empty-image {
                width: 120px;
                height: 120px;
                margin-bottom: 15px;
                opacity: 0.5;
            }

            .empty-text {
                color: #000;
                font-size: 14px;
            }
        }
    }

    // 帮助按钮样式
    .help-button {
        position: fixed;
        right: 30px;
        bottom: 30px;
        background-color: #ff7d00;
        color: white;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        font-size: 12px;

        .help-icon {
            font-size: 20px;
            margin-bottom: 3px;
        }
    }
}

// 响应式调整
@media (max-width: 768px) {
    .online-payment-container {
        .advantages-section {
            .advantages-grid {
                grid-template-columns: 1fr;
            }
        }

        .process-flow {
            flex-direction: column;

            .process-arrow {
                transform: rotate(90deg);
                margin: 10px 0;
            }
        }
    }
}
</style>